using System;
using System.Reflection;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_EDITOR
using UnityEditor.Events;
#endif
[Serializable]
public class DialogueEvent : UnityEvent<string>, IFunctionEvent{
    
    public void Add(MethodInfo method){
        #if UNITY_EDITOR
        UnityEventTools.AddPersistentListener(
            this,
            Delegate.CreateDelegate(typeof(UnityAction<string>), method) as UnityAction<string>
        );
        #endif
    }
    
}

public class DialogueFunction : MonoBehaviour
{   
    public static void Test(string s){
        Player player = GameManager.instance.game.player;
        player.AddEffect(Effect.CreatEffect("Sample"));
    }
}
